home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / business / nonlin18.zip / PIECE.NLR < prev    next >
Text File  |  1992-07-27  |  2KB  |  65 lines

  1. !  Fit a piecewise linear function that pivots at X=5.
  2. !  When X is less than 5, the slope is B1.
  3. !  When X is greater than or equal to 5, the slope is B2.
  4. !  B0 is the Y value when X=5 (i.e., at the pivot point).
  5. Title Piecewise linear function
  6. Register
  7. Variables X,Y
  8. Parameters B0,B1,B2
  9. Constant Pivot=5    ! X value at which bend occurs
  10. Function Y = step(X,Pivot)*(B0+B1*(X-Pivot)) + step(Pivot,X)*(B0+B2*(X-Pivot))
  11. Plot g
  12. Rplot g
  13. Data
  14. 1.0000        9.0640
  15. 1.1429        9.3975
  16. 1.2857        9.2018
  17. 1.4286        9.2857
  18. 1.5714        8.9093
  19. 1.7143        9.3477
  20. 1.8571        9.0515
  21. 2.0000        8.8722
  22. 2.1429        9.3411
  23. 2.2857        8.8253
  24. 2.4286        8.9658
  25. 2.5714        8.4049
  26. 2.7143        8.4536
  27. 2.8571        8.8517
  28. 3.0000        8.8919
  29. 3.1429        8.4210
  30. 3.2857        8.7708
  31. 3.4286        8.6519
  32. 3.5714        8.4829
  33. 3.7143        8.0907
  34. 3.8571        7.9835
  35. 4.0000        8.0832
  36. 4.1429        8.2473
  37. 4.2857        7.5845
  38. 4.4286        7.6238
  39. 4.5714        7.6233
  40. 4.7143        7.5825
  41. 4.8571        7.7350
  42. 5.0000        7.6635
  43. 5.1429        7.6477
  44. 5.2857        7.1760
  45. 5.4286        7.2312
  46. 5.5714        7.1163
  47. 5.7143        6.8115
  48. 5.8571        6.8880
  49. 6.0000        6.7678
  50. 6.1429        6.4633
  51. 6.2857        6.0894
  52. 6.4286        5.7891
  53. 6.5714        6.1622
  54. 6.7143        5.9032
  55. 6.8571        5.8183
  56. 7.0000        5.4021
  57. 7.1429        5.2677
  58. 7.2857        5.3045
  59. 7.4286        5.1546
  60. 7.5714        4.7516
  61. 7.7143        4.8867
  62. 7.8571        4.5282
  63. 8.0000        4.6656
  64.  
  65.